﻿@{
    ViewBag.Title = "病历模板编辑";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<script src="~/Scripts/dc_main.js"></script>
<script src="~/Scripts/jquery.min.js"></script>


<div id="myWriterControl" style="width:100%; border:2px solid black; height:700px; border-radius:5px" ContentRenderMode="NormalHtmlEditable" ServicePageURL="http://localhost:7027/EMR/MoreHandleDCWriterServicePage"></div>

<script type="text/javascript">
    $(function () {
        init();
    });
      
    function init()
    {
        var xmlstr = `<?xml version="1.0" encoding="utf-8"?>
<XTextDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" EditorVersionString="1.2015.12.23">
       <Attributes>
          <Attribute>
             <Name>DCLocalDataSource</Name>
             <Value>&lt;DataSourceDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ID="DataSource" Name="DataSource" Guid="9c34a38d-a29b-4685-83f9-db43397b4d3a" Title=""&gt;&lt;Parameters /&gt;&lt;Nodes /&gt;&lt;/DataSourceDocument&gt;</Value>
          </Attribute>
       </Attributes>
       <AutoFixTextMode>None</AutoFixTextMode>
       <XElements>
          <Element xsi:type="XTextHeader">
             <Attributes />
             <ID>divXTextDocumentHeaderElement</ID>
             <AutoFixTextMode>None</AutoFixTextMode>
             <AcceptTab>true</AcceptTab>
             <XElements>
                <Element xsi:type="XParagraphFlag" StyleIndex="7" />
                <Element xsi:type="XParagraphFlag" StyleIndex="3" />
                <Element xsi:type="XParagraphFlag" StyleIndex="3" />
                <Element xsi:type="XInputField" StyleIndex="5">
                   <Attributes />
                   <ID>机构名称</ID>
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <EnableValueValidate>true</EnableValueValidate>
                   <XElements />
                   <Deleteable>false</Deleteable>
                   <BorderElementColor />
                   <MoveFocusHotKey>Tab</MoveFocusHotKey>
                   <SpecifyWidth>1181.102</SpecifyWidth>
                   <Alignment>Center</Alignment>
                   <EventExpressions />
                   <Name>机构名称</Name>
                   <BackgroundText>机构名称</BackgroundText>
                   <LastSelectedListItems />
                </Element>
                <Element xsi:type="XParagraphFlag" StyleIndex="3" />
                <Element xsi:type="XString">
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <XElements xsi:nil="true" />
                   <Text>科别：</Text>
                </Element>
                <Element xsi:type="XInputField">
                   <Attributes />
                   <ID>科别</ID>
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <EnableValueValidate>true</EnableValueValidate>
                   <XElements />
                   <BorderElementColor />
                   <EventExpressions />
                   <Name>科别</Name>
                   <BackgroundText>科别</BackgroundText>
                   <LastSelectedListItems />
                </Element>
                <Element xsi:type="XString">
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <XElements xsi:nil="true" />
                   <Text>     床号：</Text>
                </Element>
                <Element xsi:type="XInputField">
                   <Attributes />
                   <ID>床号</ID>
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <EnableValueValidate>true</EnableValueValidate>
                   <XElements />
                   <BorderElementColor />
                   <EventExpressions />
                   <Name>床号</Name>
                   <BackgroundText>床号</BackgroundText>
                   <LastSelectedListItems />
                </Element>
                <Element xsi:type="XString">
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <XElements xsi:nil="true" />
                   <Text>床    姓名：</Text>
                </Element>
                <Element xsi:type="XInputField">
                   <Attributes />
                   <ID>姓名YM</ID>
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <EnableValueValidate>true</EnableValueValidate>
                   <ValueBinding>
                      <DataSource>EMR_Patients</DataSource>
                      <BindingPath>Name</BindingPath>
                      <BindingPathForText />
                      <Handled>true</Handled>
                   </ValueBinding>
                   <XElements />
                   <BorderElementColor />
                   <EventExpressions />
                   <Name>姓名</Name>
                   <InnerValue />
                   <BackgroundText>姓名</BackgroundText>
                   <LastSelectedListItems />
                </Element>
                <Element xsi:type="XString" StyleIndex="6">
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <XElements xsi:nil="true" />
                   <Text>    住院号：</Text>
                </Element>
                <Element xsi:type="XInputField" StyleIndex="6">
                   <Attributes />
                   <ID>住院号</ID>
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <EnableValueValidate>true</EnableValueValidate>
                   <XElements />
                   <BorderElementColor />
                   <EventExpressions />
                   <Name>住院号</Name>
                   <BackgroundText>住院号</BackgroundText>
                   <LastSelectedListItems />
                </Element>
                <Element xsi:type="XString" StyleIndex="4">
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <XElements xsi:nil="true" />
                   <Text>哈哈哈</Text>
                </Element>
                <Element xsi:type="XParagraphFlag" StyleIndex="4" />
             </XElements>
          </Element>
          <Element xsi:type="XTextBody">
             <Attributes />
             <ID>divDocumentBody_0</ID>
             <AutoFixTextMode>None</AutoFixTextMode>
             <AcceptTab>true</AcceptTab>
             <XElements>
                <Element xsi:type="XString" StyleIndex="9">
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <XElements xsi:nil="true" />
                   <Text>入院记录</Text>
                </Element>
                <Element xsi:type="XParagraphFlag" StyleIndex="7" />
                <Element xsi:type="XTextTable" NumOfRows="6" NumOfColumns="2">
                   <Attributes />
                   <ID>table1</ID>
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <Expressions />
                   <XElements>
                      <Element xsi:type="XTextTableRow">
                         <Attributes />
                         <AutoFixTextMode>None</AutoFixTextMode>
                         <Expressions />
                         <XElements>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text> 姓名：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes>
                                        <Attribute>
                                           <Name>Name</Name>
                                           <Value>张三</Value>
                                        </Attribute>
                                     </Attributes>
                                     <ID>姓名</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>Name</BindingPath>
                                     </ValueBinding>
                                     <XElements>
                                        <Element xsi:type="XString">
                                           <AutoFixTextMode>None</AutoFixTextMode>
                                           <XElements xsi:nil="true" />
                                           <Text>222</Text>
                                        </Element>
                                     </XElements>
                                     <StartBorderText>[</StartBorderText>
                                     <EndBorderText>]</EndBorderText>
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <SpecifyWidth>472.440948</SpecifyWidth>
                                     <EventExpressions />
                                     <Name>姓名</Name>
                                     <InnerValue>222</InnerValue>
                                     <BackgroundText>姓名</BackgroundText>
                                  </Element>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text> 11</Text>
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text>出生地：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>出生地</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>BirthPlace</BindingPath>
                                        <BindingPathForText />
                                        <Handled>true</Handled>
                                     </ValueBinding>
                                     <XElements />
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <EventExpressions />
                                     <Name>出生地</Name>
                                     <BackgroundText>出生地</BackgroundText>
                                     <LastSelectedListItems />
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                         </XElements>
                      </Element>
                      <Element xsi:type="XTextTableRow">
                         <Attributes />
                         <AutoFixTextMode>None</AutoFixTextMode>
                         <Expressions />
                         <XElements>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text> 性别：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>性别</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>sex</BindingPath>
                                        <BindingPathForText />
                                        <Handled>true</Handled>
                                     </ValueBinding>
                                     <XElements />
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <EventExpressions />
                                     <Name>性别</Name>
                                     <BackgroundText>性别</BackgroundText>
                                     <EditorActiveMode>Program F2 MouseClick</EditorActiveMode>
                                     <LastSelectedListItems />
                                     <FieldSettings>
                                        <EditStyle>DropdownList</EditStyle>
                                        <ListSource>
                                           <Items>
                                              <Item>
                                                 <Text>男</Text>
                                                 <Text2 />
                                                 <Value>1</Value>
                                              </Item>
                                              <Item>
                                                 <Text>女</Text>
                                                 <Text2 />
                                                 <Value>2</Value>
                                              </Item>
                                           </Items>
                                        </ListSource>
                                     </FieldSettings>
                                  </Element>
                                  <Element xsi:type="XString" WhiteSpaceLength="2">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text>  </Text>
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text>职业：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>职业</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>Job</BindingPath>
                                        <BindingPathForText />
                                        <Handled>true</Handled>
                                     </ValueBinding>
                                     <XElements />
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <EventExpressions />
                                     <Name>职业</Name>
                                     <BackgroundText>职业</BackgroundText>
                                     <LastSelectedListItems />
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                         </XElements>
                      </Element>
                      <Element xsi:type="XTextTableRow">
                         <Attributes />
                         <AutoFixTextMode>None</AutoFixTextMode>
                         <Expressions />
                         <XElements>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text> 年龄：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>年龄</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>Age</BindingPath>
                                        <BindingPathForText />
                                        <Handled>true</Handled>
                                     </ValueBinding>
                                     <XElements />
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <EventExpressions />
                                     <Name>年龄</Name>
                                     <BackgroundText>年龄</BackgroundText>
                                     <LastSelectedListItems />
                                     <FieldSettings>
                                        <EditStyle>Numeric</EditStyle>
                                     </FieldSettings>
                                  </Element>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text>岁</Text>
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text>入院时间：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>入院时间</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>indate</BindingPath>
                                        <BindingPathForText />
                                        <Handled>true</Handled>
                                     </ValueBinding>
                                     <XElements />
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <EventExpressions />
                                     <Name>入院时间</Name>
                                     <DisplayFormat>
                                        <Style>DateTime</Style>
                                        <Format>yyyy-MM-dd HH:mm:ss</Format>
                                     </DisplayFormat>
                                     <BackgroundText>入院时间</BackgroundText>
                                     <EditorActiveMode>Program F2 MouseClick</EditorActiveMode>
                                     <LastSelectedListItems />
                                     <FieldSettings>
                                        <EditStyle>DateTime</EditStyle>
                                     </FieldSettings>
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                         </XElements>
                      </Element>
                      <Element xsi:type="XTextTableRow">
                         <Attributes />
                         <AutoFixTextMode>None</AutoFixTextMode>
                         <Expressions />
                         <XElements>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text> 民族：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField" StyleIndex="8">
                                     <Attributes />
                                     <ID>民族</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>mingzu</BindingPath>
                                        <BindingPathForText />
                                        <Handled>true</Handled>
                                     </ValueBinding>
                                     <XElements />
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <EventExpressions />
                                     <Name>民族</Name>
                                     <BackgroundText>民族</BackgroundText>
                                     <EditorActiveMode>Program F2 MouseClick</EditorActiveMode>
                                     <LastSelectedListItems />
                                     <FieldSettings>
                                        <EditStyle>DropdownList</EditStyle>
                                        <ListSource>
                                           <Items>
                                              <Item>
                                                 <Text>汉族</Text>
                                                 <Text2 />
                                                 <Value>01</Value>
                                              </Item>
                                              <Item>
                                                 <Text>蒙古族</Text>
                                                 <Text2 />
                                                 <Value>02</Value>
                                              </Item>
                                              <Item>
                                                 <Text>回族</Text>
                                                 <Text2 />
                                                 <Value>03</Value>
                                              </Item>
                                              <Item>
                                                 <Text>藏族</Text>
                                                 <Text2 />
                                                 <Value>04</Value>
                                              </Item>
                                              <Item>
                                                 <Text>维吾尔族</Text>
                                                 <Text2 />
                                                 <Value>05</Value>
                                              </Item>
                                              <Item>
                                                 <Text>苗族</Text>
                                                 <Text2 />
                                                 <Value>06</Value>
                                              </Item>
                                              <Item>
                                                 <Text>彝族</Text>
                                                 <Text2 />
                                                 <Value>07</Value>
                                              </Item>
                                              <Item>
                                                 <Text>壮族</Text>
                                                 <Text2 />
                                                 <Value>08</Value>
                                              </Item>
                                              <Item>
                                                 <Text>布依族</Text>
                                                 <Text2 />
                                                 <Value>09</Value>
                                              </Item>
                                              <Item>
                                                 <Text>朝鲜族</Text>
                                                 <Text2 />
                                                 <Value>10</Value>
                                              </Item>
                                              <Item>
                                                 <Text>满族</Text>
                                                 <Text2 />
                                                 <Value>11</Value>
                                              </Item>
                                              <Item>
                                                 <Text>侗族</Text>
                                                 <Text2 />
                                                 <Value>12</Value>
                                              </Item>
                                              <Item>
                                                 <Text>瑶族</Text>
                                                 <Text2 />
                                                 <Value>13</Value>
                                              </Item>
                                              <Item>
                                                 <Text>白族</Text>
                                                 <Text2 />
                                                 <Value>14</Value>
                                              </Item>
                                              <Item>
                                                 <Text>土家族</Text>
                                                 <Text2 />
                                                 <Value>15</Value>
                                              </Item>
                                              <Item>
                                                 <Text>哈尼族</Text>
                                                 <Text2 />
                                                 <Value>16</Value>
                                              </Item>
                                              <Item>
                                                 <Text>哈萨克族</Text>
                                                 <Text2 />
                                                 <Value>17</Value>
                                              </Item>
                                              <Item>
                                                 <Text>傣族</Text>
                                                 <Text2 />
                                                 <Value>18</Value>
                                              </Item>
                                              <Item>
                                                 <Text>黎族</Text>
                                                 <Text2 />
                                                 <Value>19</Value>
                                              </Item>
                                              <Item>
                                                 <Text>傈僳族</Text>
                                                 <Text2 />
                                                 <Value>20</Value>
                                              </Item>
                                              <Item>
                                                 <Text>佤族</Text>
                                                 <Text2 />
                                                 <Value>21</Value>
                                              </Item>
                                              <Item>
                                                 <Text>畲族</Text>
                                                 <Text2 />
                                                 <Value>22</Value>
                                              </Item>
                                           </Items>
                                        </ListSource>
                                     </FieldSettings>
                                  </Element>
                                  <Element xsi:type="XString" StyleIndex="8" WhiteSpaceLength="1">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text> </Text>
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text>记录时间：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>记录时间</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>recorddate</BindingPath>
                                        <BindingPathForText />
                                        <Handled>true</Handled>
                                     </ValueBinding>
                                     <XElements />
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <EventExpressions />
                                     <Name>记录时间</Name>
                                     <BackgroundText>记录时间</BackgroundText>
                                     <EditorActiveMode>Program F2 MouseClick</EditorActiveMode>
                                     <LastSelectedListItems />
                                     <FieldSettings>
                                        <EditStyle>DateTime</EditStyle>
                                     </FieldSettings>
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                         </XElements>
                      </Element>
                      <Element xsi:type="XTextTableRow">
                         <Attributes />
                         <AutoFixTextMode>None</AutoFixTextMode>
                         <Expressions />
                         <XElements>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text> 婚姻：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>婚姻</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>marriage</BindingPath>
                                        <BindingPathForText />
                                        <Handled>true</Handled>
                                     </ValueBinding>
                                     <XElements />
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <EventExpressions />
                                     <Name>婚姻</Name>
                                     <BackgroundText>婚姻</BackgroundText>
                                     <EditorActiveMode>Program F2 MouseClick</EditorActiveMode>
                                     <LastSelectedListItems />
                                     <FieldSettings>
                                        <EditStyle>DropdownList</EditStyle>
                                        <ListSource>
                                           <Items>
                                              <Item>
                                                 <Text>未婚</Text>
                                                 <Text2 />
                                                 <Value>0</Value>
                                              </Item>
                                              <Item>
                                                 <Text>已婚</Text>
                                                 <Text2 />
                                                 <Value>1</Value>
                                              </Item>
                                              <Item>
                                                 <Text>离异</Text>
                                                 <Text2 />
                                                 <Value>2</Value>
                                              </Item>
                                              <Item>
                                                 <Text>丧偶</Text>
                                                 <Text2 />
                                                 <Value>3</Value>
                                              </Item>
                                              <Item>
                                                 <Text>其他</Text>
                                                 <Text2 />
                                                 <Value>4</Value>
                                              </Item>
                                           </Items>
                                        </ListSource>
                                     </FieldSettings>
                                  </Element>
                                  <Element xsi:type="XString" WhiteSpaceLength="2">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text>  </Text>
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text>病史陈述者：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>病史陈述者</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ValueBinding>
                                        <DataSource>EMR_Patients</DataSource>
                                        <BindingPath>patientname</BindingPath>
                                        <BindingPathForText />
                                        <Handled>true</Handled>
                                     </ValueBinding>
                                     <XElements />
                                     <BorderElementColor />
                                     <MoveFocusHotKey>Tab</MoveFocusHotKey>
                                     <EventExpressions />
                                     <Name>病史陈述者</Name>
                                     <BackgroundText>病史陈述者</BackgroundText>
                                     <LastSelectedListItems />
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                         </XElements>
                      </Element>
                      <Element xsi:type="XTextTableRow">
                         <Attributes />
                         <AutoFixTextMode>None</AutoFixTextMode>
                         <Expressions />
                         <XElements>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XString">
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <XElements xsi:nil="true" />
                                     <Text> 发病节气：</Text>
                                  </Element>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>发病季节</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <XElements />
                                     <BorderElementColor />
                                     <EventExpressions />
                                     <Name>发病节气</Name>
                                     <BackgroundText>发病节气</BackgroundText>
                                     <LastSelectedListItems />
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                            <Element xsi:type="XTextTableCell" StyleIndex="2">
                               <Attributes />
                               <AutoFixTextMode>None</AutoFixTextMode>
                               <XElements>
                                  <Element xsi:type="XInputField">
                                     <Attributes />
                                     <ID>fieldName</ID>
                                     <AutoFixTextMode>None</AutoFixTextMode>
                                     <EnableValueValidate>true</EnableValueValidate>
                                     <ContentLock>
                                        <OwnerUserID>zhangsan</OwnerUserID>
                                        <CreationTime>1980-01-01T00:00:00</CreationTime>
                                        <AuthorisedUserIDList>lisi,wangwu</AuthorisedUserIDList>
                                     </ContentLock>
                                     <XElements />
                                     <BorderElementColor />
                                     <SpecifyWidth>236.2205</SpecifyWidth>
                                     <EventExpressions />
                                     <LastSelectedListItems />
                                  </Element>
                                  <Element xsi:type="XParagraphFlag" />
                               </XElements>
                            </Element>
                         </XElements>
                      </Element>
                   </XElements>
                   <Columns>
                      <Element xsi:type="XTextTableColumn">
                         <Attributes />
                         <Width>937.375</Width>
                      </Element>
                      <Element xsi:type="XTextTableColumn">
                         <Attributes />
                         <Width>957.375</Width>
                      </Element>
                   </Columns>
                </Element>
                <Element xsi:type="XParagraphFlag" StyleIndex="1" />
                <Element xsi:type="XString">
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <XElements xsi:nil="true" />
                   <Text>                                                     医师签名：</Text>
                </Element>
                <Element xsi:type="XInputField">
                   <Attributes />
                   <ID>医师签名</ID>
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <EnableValueValidate>true</EnableValueValidate>
                   <XElements />
                   <BorderElementColor />
                   <MoveFocusHotKey>Tab</MoveFocusHotKey>
                   <SpecifyWidth>236.2205</SpecifyWidth>
                   <EventExpressions />
                   <Name>医师签名</Name>
                   <BackgroundText>医师签名</BackgroundText>
                   <LastSelectedListItems />
                </Element>
                <Element xsi:type="XParagraphFlag" StyleIndex="1" />
                <Element xsi:type="XParagraphFlag" />
             </XElements>
          </Element>
          <Element xsi:type="XTextFooter">
             <Attributes />
             <ID>divXTextDocumentFooterElement</ID>
             <AutoFixTextMode>None</AutoFixTextMode>
             <AcceptTab>true</AcceptTab>
             <XElements>
                <Element xsi:type="XString">
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <XElements xsi:nil="true" />
                   <Text>                                   第</Text>
                </Element>
                <Element xsi:type="XPageInfo">
                   <PropertyExpressions />
                   <Width>85</Width>
                   <AutoHeight>true</AutoHeight>
                   <Height>62.7343674</Height>
                   <FormatString>[%PageIndex%]</FormatString>
                </Element>
                <Element xsi:type="XString">
                   <AutoFixTextMode>None</AutoFixTextMode>
                   <XElements xsi:nil="true" />
                   <Text>页</Text>
                </Element>
                <Element xsi:type="XParagraphFlag" />
             </XElements>
          </Element>
       </XElements>
       <Parameters>
          <Parameter Name="Table-LongTermDoctorOrderModel" />
       </Parameters>
       <FileName>D:\本地桌面文件\demo\BS修改元素属性\WebApplication1\WebApplication1\DemoFile\入院记录（中医科）.xml</FileName>
       <FileFormat>XML</FileFormat>
       <UserHistories />
       <ContentStyles>
          <Default xsi:type="DocumentContentStyle">
             <FontName>宋体</FontName>
             <FontSize>12</FontSize>
          </Default>
          <Styles>
             <Style Index="0">
                <FontName>宋体</FontName>
                <FontSize>12</FontSize>
                <Align>Center</Align>
             </Style>
             <Style Index="1">
                <FontName>宋体</FontName>
                <FontSize>12</FontSize>
                <LineSpacingStyle>Space1pt5</LineSpacingStyle>
             </Style>
             <Style Index="2">
                <FontName>宋体</FontName>
                <FontSize>12</FontSize>
                <BorderWidth>1</BorderWidth>
                <PaddingLeft>15</PaddingLeft>
                <PaddingTop>10</PaddingTop>
                <PaddingRight>15</PaddingRight>
                <PaddingBottom>10</PaddingBottom>
             </Style>
             <Style Index="3">
                <FontName>宋体</FontName>
                <FontSize>12</FontSize>
                <LineSpacingStyle>SpaceMultiple</LineSpacingStyle>
                <LineSpacing>1.2</LineSpacing>
                <Align>Center</Align>
             </Style>
             <Style Index="4">
                <FontName>宋体</FontName>
                <FontSize>12</FontSize>
                <LineSpacingStyle>SpaceMultiple</LineSpacingStyle>
                <LineSpacing>1.2</LineSpacing>
             </Style>
             <Style Index="5">
                <FontName>宋体</FontName>
                <FontSize>15</FontSize>
                <Bold>true</Bold>
                <Align>Center</Align>
             </Style>
             <Style Index="6">
                <FontName>宋体</FontName>
                <FontSize>12</FontSize>
                <BorderLeft>true</BorderLeft>
                <BorderBottom>true</BorderBottom>
                <BorderTop>true</BorderTop>
                <BorderRight>true</BorderRight>
             </Style>
             <Style Index="7">
                <FontName>宋体</FontName>
                <FontSize>12</FontSize>
                <LineSpacingStyle>Space1pt5</LineSpacingStyle>
                <Align>Center</Align>
             </Style>
             <Style Index="8">
                <FontName>宋体</FontName>
                <FontSize>10.5</FontSize>
             </Style>
             <Style Index="9">
                <FontName>宋体</FontName>
                <FontSize>18</FontSize>
                <Bold>true</Bold>
             </Style>
          </Styles>
       </ContentStyles>
       <RepeatedImages />
       <ControlOptionsForDebug>
          <RuleVisible>false</RuleVisible>
          <UserInfo>
             <ID>511</ID>
             <Name>上官海燕</Name>
             <PermissionLevel>0</PermissionLevel>
          </UserInfo>
          <DocumentOptions>
             <SecurityOptions>
                <AutoEnablePermissionWhenUserLogin>false</AutoEnablePermissionWhenUserLogin>
                <TrackVisibleLevel0>
                   <UnderLineColorString>#ADD8E6</UnderLineColorString>
                   <DeleteLineColorString>#FF7F50</DeleteLineColorString>
                </TrackVisibleLevel0>
                <TrackVisibleLevel1 />
                <TrackVisibleLevel2>
                   <BackgroundColorString>#FFFFE0</BackgroundColorString>
                   <UnderLineColorNum>2</UnderLineColorNum>
                   <DeleteLineNum>2</DeleteLineNum>
                </TrackVisibleLevel2>
                <TrackVisibleLevel3>
                   <BackgroundColorString>#FFFFE0</BackgroundColorString>
                   <UnderLineColorNum>2</UnderLineColorNum>
                   <DeleteLineNum>2</DeleteLineNum>
                </TrackVisibleLevel3>
             </SecurityOptions>
             <ViewOptions>
                <NewInputContentUnderlineColor />
                <NewInputContentUnderlineColorValue>#00000000</NewInputContentUnderlineColorValue>
                <AdornTextBackColorValue>#64808080</AdornTextBackColorValue>
                <FieldHoverBackColorValue>#FFFFFF</FieldHoverBackColorValue>
                <TagColorForNormalFieldValue>#FF0000</TagColorForNormalFieldValue>
             </ViewOptions>
             <BehaviorOptions>
                <EnabledShowWinTaskBarProgress>false</EnabledShowWinTaskBarProgress>
                <ParagraphFlagFollowTableOrSection>true</ParagraphFlagFollowTableOrSection>
                <ValidateUserIDWhenEditDeleteComment>true</ValidateUserIDWhenEditDeleteComment>
                <InsertDocumentWithCheckMRID>PromptForbitWhenFail</InsertDocumentWithCheckMRID>
             </BehaviorOptions>
             <EditOptions>
                <GridLinePreviewText>DCWriter是南京都昌信息科技有限公司自主研发的专业的电子病历文档编辑器。</GridLinePreviewText>
             </EditOptions>
          </DocumentOptions>
          <Font>
             <Size>12</Size>
          </Font>
          <HeaderFooterFlagVisible>None</HeaderFooterFlagVisible>
          <JumpPrint />
          <PageTitlePosition>BottomRight</PageTitlePosition>
          <Readonly>true</Readonly>
       </ControlOptionsForDebug>
       <GlobalJavaScriptReferences />
       <Info>
          <LicenseText>南京都昌信息科技有限公司:南京都昌信息科技有限公司2019年旗舰版</LicenseText>
          <CreationTime>1980-01-01T00:00:00</CreationTime>
          <LastModifiedTime>2022-01-21T09:25:31.3146494+08:00</LastModifiedTime>
          <LastPrintTime>1980-01-01T00:00:00</LastPrintTime>
          <Operator>DCSoft.Writer Version:1.2019.1.4</Operator>
          <NumOfPage>1</NumOfPage>
       </Info>
       <BodyText>入院记录
     姓名：[222] 11 出生地：
     性别：   职业：
     年龄：岁 入院时间：
     民族：  记录时间：
     婚姻：   病史陈述者：
     发病节气：
                                                         医师签名：
</BodyText>
       <Comments />
       <LocalConfig />
       <PageSettings>
          <PageIndexsForHideHeaderFooter />
          <PrinterName />
          <PaperSource />
          <LeftMargin>95</LeftMargin>
          <RightMargin>95</RightMargin>
          <StrictUsePageSize>false</StrictUsePageSize>
       </PageSettings>
</XTextDocument>`;
        var ctl = document.getElementById("myWriterControl");
        // 绑定控件
        BindingDCWriterClientControl(ctl);
        var data = "";
        // 创建编辑器框架
        ctl.BuildFrame(function () {
            debugger;
            $.ajax({
                type: "POST",
                url: "/MedRecordTemplate/GetTemplateXml",
                data: { templateType: "0", templateName: "长期医嘱" },
                dataType: "json",
                async: false,
                success: function (respdata) {
                    debugger;
                    
                    var jsonData = JSON.stringify(respdata);
                    data = JSON.parse(jsonData);
                    ctl.LoadDocumentFromString(data.xmldata, "xml");
                    console.log(data.xmldata);
                }
            });
        });

    }

       
</script>

